package creator;

public class Property {
	private String name;
	private String type;
	private String comment;
	
	public Property(String name, String type, String comment) {
		this.name = name;
		setType(type);
		this.comment = comment;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
		formatType();
	}
	
	private void formatType() {
		type = type.replace('[', '<');
		type = type.replace(']', '>');
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public String toString() {
		StringBuffer buffer = new StringBuffer();
		buffer.append("name: ");
		buffer.append(name);
		buffer.append(", type: ");
		buffer.append(type);
		buffer.append(", comment: ");
		buffer.append(comment);
		return buffer.toString();
	}
}
